<script setup>

import SettingHeader from "@/components/SettingHeader.vue";
import {ref} from "vue";
import router from "@/router/index.js";
import {useUserStore} from "@/stores/UserStore.js";

const title = ref("设置")

const userInfo = useUserStore()

const dl = () => {
  const userStore = useUserStore()
  userStore.removeGame()
  userStore.logout()
  router.push("/login")
}
</script>

<template>
  <SettingHeader :title = "title" :url = "{name:'plCenter'}" />
  <div class = "UserInfo mt-3 ">
    <ul class = "user-info p-2">
      <li class = "d-flex " @click = "router.push({name:'userInfo'})">
        <div class = "Img border">
          <img :src = "userInfo.getUserInfo.userAvatar" width = "52" alt = "">
        </div>
        <div class = "Name_ID">
          <p class = "p-1 ml">{{ userInfo.getUserInfo.name }}</p>
          <p class = "p-1 ml">ID: {{ userInfo.getUserInfo.phone }}</p>
        </div>
      </li>
      <li class = "p-2 d-flex " @click = "router.push({name:'home'})"><span>关于签到</span> <span><svg
          t = "1738807809796" class = "icon"
          viewBox = "0 0 1024 1024" version = "1.1"
          xmlns = "http://www.w3.org/2000/svg"
          p-id = "5157"
          width = "32" height = "24"><path
          d = "M562.005333 512l-211.2-211.2 60.330667-60.288L682.666667 512l-271.530667 271.530667-60.330667-60.373334 211.2-211.2z"
          fill = "#808080" p-id = "5158"></path></svg></span></li>
      <li class = "p-2 d-flex" @click = "router.push({name:'chengJiu'})"><span>我的成就</span> <span><svg
          t = "1738807809796" class = "icon"
          viewBox = "0 0 1024 1024" version = "1.1"
          xmlns = "http://www.w3.org/2000/svg"
          p-id = "5157"
          width = "32" height = "24"><path
          d = "M562.005333 512l-211.2-211.2 60.330667-60.288L682.666667 512l-271.530667 271.530667-60.330667-60.373334 211.2-211.2z"
          fill = "#808080" p-id = "5158"></path></svg></span></li>
    </ul>

    <ul class = "user-info p-2">
      <li @click = "router.push({name:'phone'})" class = "p-2 d-flex "><span>安全与绑定</span> <span><svg
          t = "1738807809796" class = "icon"
          viewBox = "0 0 1024 1024" version = "1.1"
          xmlns = "http://www.w3.org/2000/svg"
          p-id = "5157"
          width = "32" height = "24"><path
          d = "M562.005333 512l-211.2-211.2 60.330667-60.288L682.666667 512l-271.530667 271.530667-60.330667-60.373334 211.2-211.2z"
          fill = "#808080" p-id = "5158"></path></svg></span></li>
      <li @click = "router.push({name:'steam'})" class = "p-2 d-flex "><span>Steam绑定</span> <span><svg
          t = "1738807809796" class = "icon"
          viewBox = "0 0 1024 1024" version = "1.1"
          xmlns = "http://www.w3.org/2000/svg"
          p-id = "5157"
          width = "32" height = "24"><path
          d = "M562.005333 512l-211.2-211.2 60.330667-60.288L682.666667 512l-271.530667 271.530667-60.330667-60.373334 211.2-211.2z"
          fill = "#808080" p-id = "5158"></path></svg></span></li>
    </ul>
    <div class = "logOut p-2" @click = "dl">
      退出登录
    </div>
  </div>

</template>

<style scoped>
* {
  margin: 0;
  padding: 0;
}

.UserInfo {
  margin: auto;
  width: 98%;
}

.user-info {
  margin: auto;
  width: 99%;
}

.user-info li {
  position: relative;
  border-bottom: 1px solid rgba(128, 128, 128, 0.4);
}

.user-info li span:nth-child(1) {
  line-height: 26px;
}

.user-info li span:nth-child(2) {
  position: absolute;
  right: 1%;

}

.Img {
  width: 64px;
  height: 64px;
  border: 1px solid black;
  border-radius: 100px;
  position: relative;
  overflow: hidden;
}

.Img img {
  position: absolute;
  left: 5px;
}

.ml {
  margin-left: 10px;
}

li {
  cursor: pointer;
}

.logOut {
  width: 95%;
  margin: auto;
  height: 32px;
  text-align: center;
  line-height: 15px;
  cursor: pointer;
}

</style>